[<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
VS_Pick()*           Database "pick-list" routine

Description:

  VS_Pick() allows the user to pick a record from a "pick-list" window.
  The "pick-list" window contains a subset of fields for each record in
  the database.

Syntax:     

  n_Key = VS_PICK( n_Top, n_Left, n_MaxElements, c_FldList, c_Title,
  c_Footnote, l_Index, c_EachLine, c_HdrLine, l_CanDelete, @n_CurrLine,
  ac_Procs, an_Keys )

Pass:       

  n_Top is a numeric value for the top row of the window

  n_Left is a numeric value for the left column of the window

  n_MaxElements is a numeric value representing the maximum number
  of elements (lines) to display in the window at one time

  c_FldList is a character expression representing the macro string
  of fields to display on each line.  i.e. "FRST_NAME+[ ]+LAST_NAME"

  c_Title is a character expression representing the title to be
  displayed at the top of the window (offset to the left)

  c_Footnote is a character expression representing the footnote to
  be displayed at the bottom of the window (centered)

  l_Index is a logical expression that should be set to .T. if the
  current database is indexed, otherwise it should be set to .F.

  c_Proc is a character expression that represents the procedure
  name that VS_Pick() will call before it displays each line in the
  window.

  c_HdrLine is a character expression to be displayed inside the
  window as a "header line"

  l_Index is a logical expression that should be set to .T. if the
  user is allowed to mark records for deletion, otherwise .F.

  n_CurrLine is a numeric value representing the line to place the
  light bar on (relative to top of window).  NOTE: The "@" sign is
  required in order for VS_PICK() to maintain a correct display.

  ac_Procs is an array of character expressions that tell VS_Pick()
  which procedures to call from within the window.

  an_Keys is an array of numeric values (parallel to ac_Procs)
  that indicate to VS_Pick() the INKEY() values of which keys invoke
  which procedure.  In other words, if the user presses a key listed in
  this array VS_Pick() will call the procedure named in the parallel
  element of ac_Procs.

Return:     

  n_Key is a numeric exprression that represents the INKEY() value
  of last key pressed by user

Notes:      


Example:    





  n_BarLine = 0
  c_FldList = "LAST_NAME+[ ]+FRST_NAME+[ ]+PHONE"
  DO WHILE .T.
     n_Key = VS_PICK(5,5,12,c_FldList,"Title","Footnote",;
             .T.,"","Header",.F.,@n_BarLine)
     DO CASE
        CASE n_Key = 13   && [Return]
           EDITPROG()     && Edit current record
        CASE n_Key = 22   && [Insert]
           ADD_PROG()     && Add new record
        CASE n_Key = 27   && [Escape]
           EXIT
     ENDCASE
  ENDDO

Usage:      

See Also: VS_Edit()
This page created by ng2html v1.05, the Norton guide to HTML conversion utility. Written by Dave Pearson